package com.young.test.aop;

import org.apache.log4j.Logger;

import javax.inject.Named;

import org.aspectj.lang.annotation.Aspect;
import org.aspectj.lang.annotation.Before;

import com.young.test.domain.Person;

@Named
@Aspect
public class GenericAdvice {
	/**
	 * Logger for this class
	 */
	private static final Logger logger = Logger.getLogger(GenericAdvice.class);
	
	@Before("com.young.test.aop.SystemArchitecture.genericMethodByPerson(person)")
	public void genericWithPerson(Person person){
		logger.info("----This Generic replace with Person-----");
		logger.info("Person's name is :"+person.getName());
	}
	
	@Before("com.young.test.aop.SystemArchitecture.genericMethodByString(name)")
	public void genericWithString(String name){
		logger.info("----This Generic replace with name-----");
		logger.info("Name is :"+name);
	}

}
